<?php defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.methods' );?>
<!-- 
<h2 class="contentheading"><?php echo JText::_('HIZTEGIFORM_TITLE');?></h2>
<p><?php echo JText::_('HIZTEGIFORM_DESC');?></p>
 -->
<h1>Hizkuntza Proposamena/Translation Proposal</h1>
<br/>
<?php
	if($this->show){
		?>
		<a style="float:right;" href="index.php?option=com_hizkimizki&task=adminHizkimizki" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button">
			<span class="ui-button-text">Kudeaketa</span>
		</a>
	<?php 
	}else{
		?>
		<a style="float:right;" href="index.php?option=com_users&view=login" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button">
			<span class="ui-button-text">Sartu/Login</span>
		</a>
		<?php
	}
?>
<form action="" method="post" id="transLangForm">
	<label>Erreferentzia/Reference: </label>
	<select id="langOriTrans" name="langOriTrans" onchange="submit();" style="width: 200px; text-align: center;">
		<option value="">-</option>
		<?php foreach($this->languages as $language): 
			if ($language->getId() == $this->reflang){
		?>
			<option selected="selected" value="<?php echo $language->getId(); ?>"><?php echo JText::_('LANG_'.strtoupper($language->getId()));?></option>
		<?php 
			}else{
		?>
			<option value="<?php echo $language->getId(); ?>"><?php echo JText::_('LANG_'.strtoupper($language->getId()));?></option>
		<?php
			}
		endforeach; ?>
	</select>
</form>
<br/>
<?php
	if($this->reflang != null){
?>
<form action="" method="post" id="transForm">
	<input type="hidden" id="option" name="option" value="com_hizkimizki"/>
	<input type="hidden" id="reflang" name="reflang" value="<?php echo $this->reflang; ?>">
	<input type="hidden" id="task" name="task" value="addTranslation" />
	<fieldset>
		<div class="row">
			<div class="col-left">
				<label style="margin-left: 5px;">Egilea/Author: </label><input type="text" id="name" name="name"/>
			</div>
			<div class="col-right">
				<label>Email: </label><input type="email" id="email" name="email"/>
			</div>
		</div>
		<div class= "row">
			<div class="col-left">
				<label style="margin-left: 5px;">Hizkuntza Izena/Language Name:</label><input type="text" id="language" name="language" />
			</div>
			<div class="col-right">
				<label>Hizkuntza/Language ISO-Code:</label><input style="float:right;" type="text" id="iso" name="iso" size="5" maxlength="5"/>
			</div>
		</div>
	</fieldset>
	<?php
		$side = true;
		foreach($this->refwords as $i => $word):
				if ($side) {
					echo "<div class='row'><div class='col-left'><label>$word->_word</label>: <input type='text' id='word_$word->_wordNum' name='word_$word->_wordNum'/></div>";
					$side = false;
				}
				else {
					echo "<div class='col-right'><label>$word->_word</label>: <input type='text' id='word_$word->_wordNum' name='word_$word->_wordNum'/></div></div>";
					$side = true;
				}
		endforeach;
		if (!$side) {
			echo "</div>";
		}
		?>
	<hr/>
	<center>
		<input type="submit" value="Proposatu/Propose!">
	</center>
</form>
<?php } ?>
<br/>